package com.itheima.article.fagin;

import com.itheima.article.pojo.ApAuthor;
import com.itheima.common.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name="leadnews-article",contextId = "apAuthorFagin")
public interface ApAuthorFagin {
    /**
     * 远程调用查询作者数据库
     * @param apiUserId 接收远程调用接收用户id
     *@param apiWmUserId 接收远程调用接收自媒体账号id
     * @return 返回查询到的数据给远程调用的方法
     */
    @GetMapping("/api/ApAuthor/{apiUserId}/{apiWmUserId}")
    public ResultVo<ApAuthor> findById(@PathVariable(name = "apiUserId") Long apiUserId,
                                                              @PathVariable(name = "apiWmUserId") Long apiWmUserId);

    /**
     * 远程调用添加apAuthor
     * @param apAuthor 接收远程调用返回的参数
     * @return 返回添加是否成功的数据
     */
    @PostMapping("/api/ApAuthor/add")
    public ResultVo<ApAuthor> addWmUser(@RequestBody ApAuthor apAuthor);


}
